const api = (params) => {
	let URL = "http://yzyz.fuhua91.com/myapi/" 
	return new Promise((resolve, reject) => {
			uni.showLoading({
				title: '加载中',
			})
			uni.request({
				url: URL + params.url,
				method: params.method || "GET",
				data: params.data || '',
				success: res => {
					uni.hideLoading()
					if	(res.statusCode == 200 && res.data.code == 200){
						resolve(res.data)
					}else{
						uni.showToast({
							title:res.data.msg || "请求出错"
						})
					}
				}
	
			})
		})
}
export default api